#pragma once

#include <memory>
#include "Containers/String.h"
#include "ScriptCompiler/Description/IdentifierDescription.h"
#include "DecoratedTypeDescription.h"

class CStatementContext;

class CVariableDescription : public IIdentifierDescription
{
public:
    virtual EIdentifierType GetIdentifierType() const override
    {
        return EIdentifierType::Variable;
    }

    virtual CString GetSearchName()  const override;


    SDecoratedTypeDescription Type;
    CString Name; //might be empty for Anonymous variable

    //index in local variable array,
    int32_t Index = -1;

    //the sentence that declare this variable
    //of course,it is nullptr for anonymous variable
    std::shared_ptr<CStatementContext> DeclareSentence;
};